<!doctype html>
<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
    <link rel="stylesheet" href="common/testing.css"/>
    <title>sqlite3 WASM Testing Page Index</title>
  </head>
  <body>
    <style>
      header {
          background: #044a64;
          color: white;
          padding: 0.5em;
          border-radius: 0.25em;
      }
    </style>
    <header id='titlebar'><span>sqlite3 WASM test pages</span></header>
    <hr>
    <div>Below is the list of test pages for the sqlite3 WASM
      builds. All of them require that this directory have been
      "make"d first. The intent is that <em>this</em> page be run
      using:</div>
    <blockquote><pre>althttpd -enable-sab -page index.html</pre></blockquote>
    <div>and the individual tests be started in their own tab.
      Warnings and Caveats:
      <ul class='warning'>
        <li>All of these pages must be served via an HTTP
          server. Browsers do not support loading WASM files via
          file:// URLs.</li>
        <li>Any OPFS-related pages or tests require:
          <ul>
            <li>An OPFS-capable browser released after February
              2023. Some tests will work with Chromium-based browsers
              going back to around v102.</li>
            <li>That the web server emit the so-called
              <a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy'>COOP</a>
              and
              <a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy'>COEP</a>
              headers. <a href='https://sqlite.org/althttpd'>althttpd</a> requires the
              <code>-enable-sab</code> flag for that.
            </li>
          </ul>
        </li>
      </ul>
    </div>
    <div>The tests and demos...
      <ul id='test-list'>
        <li>Core-most tests
          <ul>
            <li>tester1 (<a href='tester1.html'>32-bit</a>
              <a href='tester1-64bit.html'>64-bit</a>): Core unit and
              regression tests for the various APIs and surrounding
              utility code.</li>
            <li>tester1-esm (<a href='tester1-esm.html'>32-bit</a>
              <a href='tester1-esm-64bit.html'>64-bit</a>): same as
              <code>tester1</code> but loads sqlite3 in the main thread via
              an ES6 module.
            </li>
            <li>tester1-worker (<a href='tester1-worker.html'>32-bit</a>
              <a href='tester1-worker-64bit.html'>64-bit</a>): same thing
              but running in a Worker.</li>
            <li>tester1-worker ESM (<a href='tester1-worker.html?esm'>32-bit</a>
              <a href='tester1-worker-64bit.html?esm'>64-bit</a>): same as
              tester1-worker but loads a Worker Module which then
              loads the sqlite3 API via an ES6 module. Not all
              browsers permit loading modules in Worker threads.
            </li>
          </ul>
        </li>
        <li>High-level apps and demos...
          <ul>
            <li><a href='fiddle/index.html'>fiddle</a> is an HTML front-end
              to a wasm build of the sqlite3 shell.</li>
            <li><a href='demo-123.html'>demo-123</a> provides a
              no-nonsense example of adding sqlite3 support to a web
              page in the UI thread.</li>
            <li><a href='demo-123-worker.html'>demo-123-worker</a> is
              the same as <code>demo-123</code> but loads and runs
              sqlite3 from a Worker thread.</li>
            <li><a href='demo-jsstorage.html'>demo-jsstorage</a>: very basic
              demo of using the key-value VFS for storing a persistent db
              in JS <code>localStorage</code> or <code>sessionStorage</code>.</li>
            <li><a href='demo-worker1.html'>demo-worker1</a>:
              Worker-based wrapper of the OO API #1. Its Promise-based
              wrapper is significantly easier to use, however.</li>
            <li><a href='demo-worker1-promiser.html'>demo-worker1-promiser</a>:
              a demo of the Promise-based wrapper of the Worker1 API.</li>
            <li><a href='demo-worker1-promiser-esm.html'>demo-worker1-promiser-esm</a>:
              same as the previous demo except loads the promiser from an ESM module.</li>
          </ul>
        </li>
        <li>speedtest1 ports (sqlite3's primary benchmarking tool)...
          <ul>
            <li>speedtest1
              (<a href='speedtest1.html'>32-bit</a>,
              <a href='speedtest1-64bit.html'>64-bit</a>):
              a main-thread WASM build of speedtest1.</li>
            <li>speedtest1?vfs=kvvfs
              (<a href='speedtest1.html?vfs=kvvfs'>32-bit</a>,
              <a href='speedtest1-64bit.html?vfs=kvvfs'>64-bit</a>):
              speedtest1 with the kvvfs.</li>
            <li>speedtest1-worker
              (<a href='speedtest1-worker.html?size=15'>32-bit</a>,
              <a href='speedtest1-worker-64bit.html?size=15'>64-bit</a>):
              an interactive Worker-thread variant of speedtest1.</li>
            <li>speedtest1-worker?vfs=opfs
              (<a href='speedtest1-worker.html?vfs=opfs&size=10'>32-bit</a>,
              <a href='speedtest1-worker-64bit.html?vfs=opfs&size=10'>64-bit</a>):
              speedtest1-worker with the
              OPFS VFS preselected and configured for a moderate workload.</li>
            <li>speedtest1-worker?vfs=opfs-sahpool
              (<a href='speedtest1-worker.html?vfs=opfs-sahpool&size=10'>32-bit</a>,
              <a href='speedtest1-worker-64bit.html?vfs=opfs-sahpool&size=10'>64-bit</a>):
              speedtest1-worker with the OPFS-SAHPOOL VFS preselected
              and configured for a moderate workload.
            </li>
          </ul>
        </li>
        <li>The obligatory "misc." category...
          <ul>
            <li><a href='module-symbols.html'>module-symbols</a> gives
              a high-level overview of the symbols exposed by the JS
              module.</li>
            <!--li><a href='batch-runner.html'>batch-runner</a>: runs batches of
                SQL exported from speedtest1.</li-->
            <li><a href='test-opfs-vfs.html'>test-opfs-vfs</a>
              (<a href='test-opfs-vfs.html?opfs-sanity-check&opfs-verbose'>same
              with verbose output and sanity-checking tests</a>) is an
              sqlite3_vfs OPFS proxy using SharedArrayBuffer and the
              Atomics APIs to regulate communication between the
              synchronous sqlite3_vfs interface and the async OPFS
              impl.
            </li>
            <li><a href='tests/opfs/concurrency/index.html'>OPFS concurrency</a>
              tests using multiple workers.
            </li>
            <li><a href='tests/opfs/sahpool/index.html'>OPFS SAHPool cooperative semi-concurrency</a>
              demonstrates usage of the OPFS SAHPool VFS's "pause" feature to coordinate
              access to a database.
            </li>
            <li><a href='SQLTester/index.html'>SQLTester</a> is
              another testing tool for the library but making use of
              it requires tests from an external, proprietary
              project. Despite not being useful to the general public,
              a link to it is in this list so that its developer has
              easy access to it.
            </li>
          </ul>
        </li>
        <li><strong>WASMFS</strong>-specific tests which require that
          the WASMFS build is available on this server (it is not by
          default) and that this server emits the COOP/COEP headers.
          <ul>
            <li><a href='scratchpad-wasmfs.html'>scratchpad-wasmfs</a>:
              experimenting with WASMFS/OPFS-based persistence.
            </li>
            <!--speedtest1-wasmfs's build was broken in refactoring and it
                has not been used in years, but it may be interesting
                to revisit someday
                li><a href='speedtest1-wasmfs.html?flags=--size,10'>speedtest1-wasmfs</a>:
              a variant of speedtest1 built solely for the wasmfs/opfs
              feature.
            </li-->
          </ul>
        </li>
        <!--li><a href='x.html'></a></li-->
      </ul>
    </div>
    <style>
      #test-list { font-size: 120%; }
    </style>
    <script>//Assign a distinct target tab name for each test page...
      document.querySelectorAll('a').forEach(function(e){
          e.target = e.href.replace(/^http*:\/\/[^/]+\//, '');
      });
    </script>
  </body>
</html>
